#include "StdAfx.h"
#include "Grs.h"
#include "OceanViewFactory.h"


CGrs::CGrs(int inAmount, int outAmount, double* outs):CGtsNode(inAmount, outAmount, outs)
{	
    view=(new  OceanViewFactory())->createGrsView();
	
}


CGrs::~CGrs()
{
}

void CGrs::correctState()
{
	if(getInFlow() < 0.001)
       iState=NORMAL_STATE;
	double result = (getInFlow()-getOutFlow())/getInFlow();
	if(result==0)
		iState=NORMAL_STATE;
	else if(result>0.2)
		iState=CRITICAL_STATE;
	else
		iState=WARNING_STATE;
}